Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Public worksheets for UCLA's Mathematics for Life Scientists course
Note: If you want to use any of the interactives in this worksheet (highly recommended), click the link that says “Open in CoCalc” at the top right of the page.
The period-doubling path to chaos
and the corresponding bifurcation diagrams
We have seen in class that in the discrete-time logistic model, as we vary the parameter between and , we get a series of bifurcations.
When , the system goes to a stable equilibrium. That equilibrium point is at when , but is nonzero when . Right at , a Hopf bifurcation occurs, so that when (up to about ) the system goes to a stable oscillation between two values.
The interactive below allows you to explore this.
For values a little larger than , the system starts to display a new type of behavior: after some transient behavior, it settles into a cycle that repeats itself, but rather than cycling between just two values of , it cycles between four values! That is, instead of just repeating a pattern like A-B-A-B-A-B... (where A represents a low value of and B represents a higher value), it repeats a pattern of the form A-C-B-D-A-C-B-D-A-C-B-D. This is still periodic behavior, because it is repeating the same values over and over, but now the period is rather than , because it takes time steps before it repeats.
Since increasing the parameter past the threshold of caused the oscillations to go from period to period , we say that a period-doubling bifurcation occurred at .
This new “period behavior” can be seen in the steady-state part of the graph below.
Slightly farther along, after about , the pattern of behavior changes again, this time to A-E-D-G-B-F-C-H-A-E-D-G-B-F-C-H-A-E-D-G-B-F-C-H. That is, the cycle now has period . Another period-doubling bifurcation has occurred!
After around , the behavior changes to period (another period-doubling bifurcation), and after about , it changes to period (yet another period-doubling bifurcation). You can explore all of these in the interactive below.
What you should be noticing about the values mentioned above is that they are getting closer and closer together. Here is a summary:
: Hopf bifurcation, start of period 2 oscillations
: First period-doubling bifurcation, start of period 4 oscillations
: Second period-doubling bifurcation, start of period 8 oscillations
: Third period-doubling bifurcation, start of period 16 oscillations
: Fourth period-doubling bifurcation, start of period 32 oscillations
etc...
In fact, between the Hopf bifurcation at and somewhere around , an infinite number of period-doubling bifurcations occur! But because they keep occuring closer and closer together, all infinitely many of them fit within the relatively short interval of values from to .
Then, for values of greater than about , the behavior changes again, this time to chaotic behavior.
In the interactive below, you can see the behavior for specific values in this range, plus a few larger values showing chaotic behavior. The first plot shows the time series from to . The first iterations have been discarded, to get rid of any transient behavior and just show the steady-state pattern. Although it's a discrete-time model, this plot was made with plotjoined=True
to help show the pattern of the oscillation. In the same interactive, the second plot also shows only the steady-state behavior (by discarding the first iterations again), but this time shows many more iterations, with plotjoined=False
and very small points. This makes it much easier to see how many distinct values are hit in the oscillation pattern, so it's easy to see what the period of the oscillation is.
We can create a bifurcation diagram that summarizes all of these behaviors in a way that's very similar to the bifurcation diagrams we studied in LS 30A. The parameter () value goes on the horizontal axis, and the vertical axis is the state variable (), so that each vertical slice of the graph represents a copy of the state space for a specific value. However, instead of just plotting the equilibrium points (and indicating their stability with colors or a line pattern), here we will plot, for each value, all of the values that are part of the steady-state oscillation pattern at that value of . So counting the points in any vertical slice of the diagram will tell you the period of the oscillation. Here is that diagram:
As you can see, the Hopf bifurcation at shows up here as a “branching”, where the curve forks into two curves. Likewise, each period-doubling bifurcation appears as an value at which all of the curves simultaneously branch in the same way: curves branch into curves, then curves branch into curves, then curves branch into curves, etc.
The regions of chaotic behavior (most of the graph where is greater than about ) show up as a sort of fuzzy gray area, because for these values, the system no longer generates a finite sequence of values that repeats periodically. Instead, since chaotic behavior is aperiodic, the sequence of states will include infinitely many different values. To produce this picture, instead of just plotting a point for every value, we have shaded each point lighter or darker depending on how frequently the sequence of values hit that point. When the behavior is periodic, every value in the periodic pattern gets hit just as often as every other one, so those points are colored uniformly black. But when it's chaotic, some values occur more frequently than others, so some are shaded darker and some are lighter.
(Note: I have not included the code used to produce these diagrams in this worksheet, but they were produced in CoCalc using SageMath. If you'd like to see/use the code yourself, contact me.)
Here is a higher-resolution version, showing just the more interesting range from to .
One thing that you might notice in these diagrams is that, for some values greater than , the chaotic behavior seems to suddenly disappear for a little while, and a few individual curves appear again, indicating that the system has returned to periodic behavior! Probably the most visible of these regions is around . What does the period seem to be there? If you look closely, shortly after that value, the system goes through another period-doubling bifurcation. In fact, although it's hard to see it without zooming in much more, the system will once again undergo infinitely many more period-doubling bifurcations (all between and about ) before returning to chaotic behavior! This means that if you were to zoom in on a rectangle defined by roughly and , the diagram would look very similar to the region of the graph from to ... that is, most of the whole graph that you see above! Mathematicians call this property self-similarity, and images that are self-similar are often referred to as fractals. The self-similarity of bifurcation diagrams like this one is one of the deep connections between chaotic dynamical systems and fractal geometry.
The region we've just described isn't the only one with periodic behavior in the middle of all the chaos. Everywhere in the chaotic region where you see a white vertical band, there should be periodic behavior with some finite period. With the help of the diagram above, see if you can use the interactive below to find values where the behavior is periodic with period , period , period , and period . What other periods can you find?
What about other chaotic systems?
Does a similar pattern of bifurcations happen in other models that show chaotic behavior? And in particular, can we find anything equivalent to the period-doubling bifurcations that we saw above in a continuous-time (differential equation) model? Could we even make a bifurcation diagram in a similar way, and if so, what will it look like?
The answers to all of these questions are yes, yes, yes, and surprisingly similar to the bifurcation diagrams that we just saw!
My favorite example of this in continuous time is the Rössler model (which you covered in one of your labs as the “Romeo-Juliet-Tybalt” model). As a reminder, in this model, represents Romeo's love (or hatred if negative) for Juliet, represents Juliet's love/hatred for Romeo, and represents Tybalt's hatred of Romeo. The system of differential equations is In your lab, you studied this model with the parameter (in the equation) set to . But since we're interested in studying bifurcations of this model, we need to vary a parameter, so the parameter is the one we'll work with.
Note that since there are three state variables in this model (as is necessary to get chaotic behavior from an ODE), the graphs of trajectories shown below will all be 3D graphs.
The first graph below shows, in different colors, a few different trajectories of this model for the parameter value . You should see a very familiar feature here.
As you can see, the slightly thicker blue loop, which the red and pink trajectories approach asymptotically, is a limit cycle attractor. So when , this model already shows periodic behavior. (It turns out that it's not possible to get a stable equilibrium point for any value of the parameter , so we can't get a Hopf bifurcation by varying this parameter.)
From now on, since we are only interested in the steady-state behavior, we will do as we did for the discrete-time logistic model above, and throw away the earlier part of our simulation to get rid of any transients.
The next two graphs show just the limit cycle attractor for the parameter values and . What happens between these two values?
What just happened?
If you look closely, each of the above trajectories is a closed loop, so the behavior we're seeing here is periodic. However, in the second one, the trajectory has wound around the axis twice before closing the loop. If you consider the amount of time required for the trajectory to wind around the axis once, it's not hard to imagine (even though we can't see in the graph) that it would take about twice as much time to go around twice. In other words, it's likely the the period of the oscillatory behavior in the second () graph is about twice as long as the period of the oscillation in the first () graph.
To summarize what we just said: as the parameter was increased, somewhere between and the period of the oscillation doubled. What does that mean? You guessed it. That's a period-doubling bifurcation!
To see what we mean about the period as a time interval, take a look at the two time series below for the variable. The period of the oscillation can be measured here as the horizontal distance between the peaks. In the first () graph, that period is approximately . In the second () graph, it's approximately . Hence, the period doubled.
The interactive below will show you both the trajectory and the time series (for the variable) of this model, for a handful of specific values of . These values of show a sequence of period-doubling bifurcations, and eventually chaotic behavior.
As with the discrete-time logistic model that we considered earlier, we can create a bifurcation diagram showing the changes in behavior as we vary the parameter . Here it is:
Notice how similar this is to the bifurcation diagram from the discrete-time logistic model. Of course, the precise details are different. But the overall shape or pattern of behavior is exactly the same: we see a sequence of period-doubling bifurcations, occurring closer and closer together, until suddenly chaotic behavior happens. Then, within the region of chaotic behavior, there are small windows of periodic behavior that appear for short parameter intervals, and even within these more period-doubling bifurcations can be seen. Also, within the region of chaotic behavior, some values of the state variable ( in this case) occur more frequently, and others less frequently, resulting in darker or lighter shading. From this, a complex pattern can be seen through the chaos.
If you're following closely how these bifurcation diagrams are created, you might be wondering how this one can be made, since there are now state variables in this model instead of , and the trajectory moves smoothly through the state space instead of jumping from one point to another as in a discrete-time model. In this case, we have “discretized” the steady-state behavior of the system by looking at the points where the trajectory intersects the plane. We have then decreased these -dimensional points to -dimensional data by looking only at the value of the variable at each point (since the values at these points are quite close to and don't vary much). This is the reason that the vertical axis in the bifurcation diagram above is labeled : it gives the coordinates of the points at which the trajectory intersects the plane. Similar tricks can be employed in other continuous-time models with chaotic behavior.
You can use the interactive below to explore this model further for the whole range of values of shown above. With the help of the above bifurcation diagram, see if you can use this interactive to find values where the limit cycle attractor winds around the axis times before forming a loop. What about times, or times, or times?
The Hastings -species food chain model
Recall the following model from class (and your textbook), in which is the population of a top predator such as wolves, is the population of a middle species, such as sheep, that is preyed upon by the top predator but is also a predator of the bottom species, , which might be, for example, grass.
We have seen in class that the parameter values , , , , , , , , , gives rise to chaotic behavior. We will now look at what happens as we vary the parameter , leaving all the other parameters the same.
Below is an interactive that allows you to explore this, followed by the resulting bifurcation diagram. Again, see if you can find values of the parameter that give rise to an ordinary limit cycle attractor, and to a limit cycle attractor that winds around , , or times before forming a closed loop.
Bifurcation diagram for the Hastings model (Note: The parameter is called in the diagram, but it corresponds to what we've called above.)
It is also possible to generate a bifurcation diagram like this for the Lorenz model (which was covered in your lab as “Romeo, Juliet, and Juliet's Nurse”). Once again, it will have most of the exact same features as all of the bifurcation diagrams we have looked at above. The precise shape will be different, but in terms of its overall look, you could say all of these look “about the same”.
Summary: What these bifurcation diagrams mean
In brief, a bifurcation diagram like the one above means that as we increase the parameter , the steady-state behavior of the system changes in the following way:
Here, “complex oscillations” refer to the oscillatory behavior with higher periods, after one or more period-doubling bifurcations have occurred.
Recall that the change from equilibrium to oscillations is a Hopf bifurcation, and the change from regular oscillations to complex oscillations is a period-doubling bifurcation. Also, within the region of complex oscillations, infinitely many more period-doubling bifurcations occur, closer and closer together. This is sometimes referred to as a “period-doubling cascade”, which then leads to chaotic behavior. In general, the above pattern is often referred to as the “period-doubling route to chaos”.